<template>
  <div class="bg-table-1">
    <div class="bg-table-body">
      <div class="bg-table-body-header">
        <template v-for="item in header">
          <slot :name="item.value" :data="item">
            <div style="width: 25%; text-align: center;">
              <span>122</span>
            </div>
          </slot>
        </template>
      </div>
      <div class="bg-table-body-content">
        <div
          v-for="(item, index) in list"
          class="bg-table-body-content-item"
        >
          <slot v-for="(item1, key) in item" :name="'item' + key" :data="item">
            <div style="width: 25%; text-align: center;">
              <span>{{ item1 }}</span>
            </div>
          </slot>
        </div>
      </div>
    </div>
  </div>
</template>
<script>
export default {
  data() {
    return {
      header: [
        {
          label: '123',
          value: 'headera',
        },
        {
          label: '123',
          value: 'headerb',
        },
        {
          label: '123',
          value: 'headerc',
        },
        {
          label: '123',
          value: 'headerd',
        },
      ],
      list: [
        {
          headera: '123',
          headerb: '123',
          headerc: '123',
          headerd: '123',
        },
        {
          headera: '123',
          headerb: '123',
          headerc: '123',
          headerd: '123',
        },
        {
          headera: '123',
          headerb: '123',
          headerc: '123',
          headerd: '123',
        },
        {
          headera: '123',
          headerb: '123',
          headerc: '123',
          headerd: '123',
        },
        {
          headera: '123',
          headerb: '123',
          headerc: '123',
          headerd: '123',
        },
        {
          headera: '123a',
          headerb: '123s',
          headerc: '123s',
          headerd: '123s',
        },
      ],
    }
  },
}
</script>
<style lang="scss">
.bg-table-body {
  width: 432px;
  .bg-table-body-header {
    width: 100%;
    height: 36px;
    opacity: 1;

    /* 自动布局 */
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    padding: 8px 10px;
    align-self: stretch;

    background: rgba(18, 74, 63, 0.6);

    z-index: 0;
    span {
      opacity: 1;
      font-family: 思源黑体;
      font-size: 14px;
      font-weight: bold;
      line-height: 20px;
      letter-spacing: 0em;

      font-variation-settings: 'opsz' auto;
      color: #ffffff;

      z-index: 0;
    }
  }
  .bg-table-body-content {
    height: 180px;
    overflow-y: auto;
    overflow-x: hidden;
  }
  .bg-table-body-content-item {
    width: 432px;
    height: 36px;
    opacity: 1;
    /* 自动布局 */
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    padding: 8px;
    align-self: stretch;

    z-index: 1;
    span {
      opacity: 1;
      font-family: 思源黑体;
      font-size: 14px;
      font-weight: bold;
      line-height: 20px;
      letter-spacing: 0em;

      font-variation-settings: 'opsz' auto;
      color: #f4ecec;

      z-index: 0;
    }
  }
}
</style>
